package com.design.mode.aop;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @ClassName AppTest
 * @Description TODO
 * @Author xiongchao
 * @Date 2020/10/10 13:57
 **/
public class AppTest {
    public static void main(String[] args) {
        /*AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        Boy boy = context.getBean("boy",Boy.class);
        Girl girl = (Girl) context.getBean("girl");
        boy.buy();
        girl.buy();*/

        AnnotationConfigApplicationContext configApplicationContext = new AnnotationConfigApplicationContext(AppConfigd.class);

        Boys boys = configApplicationContext.getBean("boys",Boys.class);
        Girls girls = (Girls) configApplicationContext.getBean("girls");

        System.out.println("男孩买了{}" + boys.buy(46.3));
        System.out.println("女孩买了" + girls.buy(99.8));





    }
}
